package com.ayf.payment.game.api.mapper;

import com.ayf.payment.game.api.dto.criteria.CleanCriteria;
import com.ayf.payment.game.api.entity.MerchantBudget;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface MerchantBudgetMapper extends Mapper<MerchantBudget> {

    /**
     * 商户收支记录查询
     *
     * @param merchantId
     * @return
     */
    List<MerchantBudget> selectBudgets(@Param("merchantId") Integer merchantId);

    /**
     * 查询商户前天的余额信息
     *
     * @param ids
     * @return
     */
    @MapKey("merchant_id")
    Map<Integer, Map<String, Object>> selectBalance(@Param("date") String date, @Param("ids") List<Integer> ids);

    /**
     * 商户收支记录添加
     *
     * @param list
     * @return
     */
    int insertBudgets(@Param("list") List<MerchantBudget> list);

    /**
     * 清理收支信息
     *
     * @param clean
     * @return
     */
    int cleanBudgets(@Param("clean") CleanCriteria clean);
}